#pragma once

#include "Misc/EngineEditorMacros.h"
#include "Object/Object.h"
#include "MaterialGraphView.m.h"

class RMaterialGraphViewModel;
class RWidget;
class RMaterialGraphNodeView;
class RMaterialGraphLinkView;

RCLASS()
class RMaterialGraphView : public RObject
{
    ROBJECT

public:
    virtual void BindViewModel(TSharedObjectPtr<RMaterialGraphViewModel> InViewModel) ;
    virtual void CreateWidget(TSharedObjectPtr<RWidget> InParentWidget) ;
protected:
    TWeakObjectPtr<RMaterialGraphViewModel> GraphViewModel;

    TVector<TSharedObjectPtr<RMaterialGraphNodeView>> NodeViews;

    TVector<TSharedObjectPtr<RMaterialGraphLinkView>> LinkViews;

    TWeakObjectPtr<RWidget> Root;
    TWeakObjectPtr<RWidget> NodeOverlay;
    TWeakObjectPtr<RWidget> LinkOverlay;

public:  

    void ClearNodeSelection();
    void DeleteSelectedNode();

    void AddFloatNodeAtMouse();

    void AddVectorNodeAtMouse();

    void AddPropertyNodeAtMouse();

    void AddTextureNodeAtMouse();

    void AddOperationNodeAtMouse();

    void AddVectorOperationNodeAtMouse();

    void AddSplitVectorNodeAtMouse();

    void AddCameraNodeAtMouse();

    void AddDelayBRDFNodeAtMouse();

    void AddUnlitNodeAtMouse();
};